const state = {
  avatar: null,
  name: null,
  phone: null,
  siteId: null,
  userId: null,
  empId: null,
  userStatus: null
};

const mutations = {
  updateUserInfo: state => {
    state.avatar = uni.getStorageSync("avatar");
    state.name = uni.getStorageSync("name");
    state.phone = uni.getStorageSync("phone");
    state.siteId = uni.getStorageSync("siteId");
    state.userId = uni.getStorageSync("userId");
    state.empId = uni.getStorageSync("empId");
    state.userStatus = uni.getStorageSync("userStatus");
  },
  clearUserInfo: state => {
    state.avatar = null;
    state.name = null;
    state.phone = null;
    state.siteId = null;
    state.userId = null;
    state.empId = null;
    state.userStatus = null;
  }
};

export default {
  namespaced: true,
  state,
  mutations
};
